// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 根据分类id获取菜品集合 GET /setmeal/categoryId */
export async function listByCategoryId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listByCategoryIdParams,
  options?: { [key: string]: any },
) {
  return request<API.CommonResultListSetMeal>('/setmeal/categoryId', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 新增套餐 POST /setmeal/create */
export async function saveSetMeal(body: API.SetMeal, options?: { [key: string]: any }) {
  return request<any>('/setmeal/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id删除套餐 DELETE /setmeal/delete */
export async function deleteSetMealById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteSetMealByIdParams,
  options?: { [key: string]: any },
) {
  return request<any>('/setmeal/delete', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 批量删除套餐 DELETE /setmeal/deletes */
export async function deleteSetMealByIds(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteSetMealByIdsParams,
  options?: { [key: string]: any },
) {
  return request<any>('/setmeal/deletes', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 根据id查询套餐 GET /setmeal/get */
export async function querySetMealById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.querySetMealByIdParams,
  options?: { [key: string]: any },
) {
  return request<API.CommonResultSetMeal>('/setmeal/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 根据id批量查询套餐 GET /setmeal/gets */
export async function querySetMealByIds(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.querySetMealByIdsParams,
  options?: { [key: string]: any },
) {
  return request<API.CommonResultListSetMeal>('/setmeal/gets', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 分页查询套餐 POST /setmeal/list */
export async function querySetMealByPage(
  body: API.SetMealPageQuery,
  options?: { [key: string]: any },
) {
  return request<API.PageResponseSetMeal>('/setmeal/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新套餐状态 PUT /setmeal/status/${param0}/${param1} */
export async function updateSetMealStatus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.updateSetMealStatusParams,
  options?: { [key: string]: any },
) {
  const { id: param0, status: param1, ...queryParams } = params;
  return request<any>(`/setmeal/status/${param0}/${param1}`, {
    method: 'PUT',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新套餐 PUT /setmeal/update */
export async function updateSetMeal(body: API.SetMeal, options?: { [key: string]: any }) {
  return request<any>('/setmeal/update', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
